﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>主生产计划横道图</title>

    <link href="~/Content/themes/icon.css" rel="stylesheet" />  
    <!--
   
        -->
    <script src="~/Scripts/jquery-easyui/jquery.min.js"></script>
    <script src="~/Scripts/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <link href="~/jQuery.Gantt/gantt2/jquery.ganttView.css" rel="stylesheet" />

    <script src="~/jQuery.Gantt/gantt2/lib/date.js"></script>
    <script charset="UTF-8" src="~/jQuery.Gantt/gantt2/easyUI.ganttView.js"></script>
    
    <link href="~/Scripts/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    
    <link href="~/Content/themes/table.css" rel="stylesheet" /> 
    <script type="text/javascript">
    $(function () {
        $("#ganttChart").ganttView({
            dataUrl: "/Project/GetPageProjectInfo",
            paradata:{view:"ProjectGantt",rows:5},
            slideWidth: $(window).width() - 500,
            //afterload: function (data) { alert("数据加载完毕！！"+data);},
            behavior: {
                //onClick: function (data) {
                //    var msg = "点击事件: { start: " + data.start.toString("M/d/yyyy") + ", end: " + data.end.toString("M/d/yyyy") + " }";
                //    $("#eventMessage").text(msg);
                //},
                //onResize: function (data) {
                //    var msg = "调整事件: { start: " + data.start.toString("M/d/yyyy") + ", end: " + data.end.toString("M/d/yyyy") + " }";
                //    $("#eventMessage").text(msg);
                //}//,
                // onDrag: function (data) {
                //   var msg = "拖拽事件: { start: " + data.start.toString("M/d/yyyy") + ", end: " + data.end.toString("M/d/yyyy") + " }";
                // $("#eventMessage").text(msg);
                //}
            }
        });
        $('#pp').pagination({                   
        total: 2000,
        pageSize: 5,
        pageList: [5,10,15,20],
        onSelectPage: function (pageNumber, pageSize) {
            $(this).pagination('loading');           
            $("#ganttChart").ganttView("destroy", 0);
            $("#ganttChart").ganttView({
                dataUrl: "/Project/GetPageProjectInfo",
                paradata: {
                    view: "ProjectGantt", rows: pageSize,page:pageNumber,
                    FBillNo: $('#FBillNo').val(),
                    FName: $('#FName').val(),
                    FStatus: $('#FStatus').val(),
                    ifchangepwd: $('#selIfChangepwd').val(),
                    FPlanCommitDate: $('#FPlanCommitDate').datetimebox('getValue')                   
                },
                slideWidth: $(window).width() - 260,               
                behavior: {}
            });
            $(this).pagination('loaded');
        }
        });
       

        // $("#ganttChart").ganttView("setSlideWidth", 600);


        //回车搜索
        $("#ui_order_search").find('input').on('keyup', function (event) {
            if (event.keyCode == '13') {
                ui_project_searchdata();
            }
        })
    });

    //搜索任务单
    function ui_project_searchdata() {
        $("#ganttChart").ganttView("destroy",0);
           $("#ganttChart").ganttView({
            dataUrl: "/Project/GetPageProjectInfo",
            paradata: { view: "ProjectGantt", rows: 5,
                FBillNo: $('#FBillNo').val(),
                FName: $('#FName').val(),
                FStatus: $('#FStatus').val(),
                ifchangepwd: $('#selIfChangepwd').val(),
                FPlanCommitDate: $('#FPlanCommitDate').datetimebox('getValue')
            },
            slideWidth: $(window).width() - 260,
            behavior: {  }
        });
    }
    //清除搜索条件
    function ui_project_cleardata() {
        $('#ui_user_search input').val('');
        $('#ui_user_search select').val('select');
        $('#txtAddBeginDate').datetimebox('setValue', '');
        $('#txtAddEndDate').datetimebox('setValue', '');
        $("#ui_user_dg").datagrid('load', {});

        $("#ui_user_dg").datagrid('clearSelections').datagrid('clearChecked');
    }
    function ui_project_cleargantt() {
        $("#ganttChart").ganttView("destroy",0);
    }
</script>



</head>


<body>
 

    <div id="ui_user_layout" class="easyui-layout" data-options="fit:true,border:false">
        <div data-options="region:'north',split:true,border:true,collapsed:true" title="条件搜索" style="height:104px;">
            <div id="ui_order_search">
                <table class="tableForm" style="width: 99%; height: 100%; background: #F5F5F5;">
                    <tr>
                        <th>
                            订单号：
                        </th>
                        <td>
                            <input name="FBillNo" id="FBillNo" class="easyui-validatebox textbox" style="width:150px;height:22px;" />
                        </td>

                        <th>
                            物料名称：
                        </th>
                        <td>
                            <input name="FName" id="FName" class="easyui-validatebox textbox" style="width:150px;height:22px;" />
                        </td>

                        <th>
                            订单状态：
                        </th>
                        <td>
                            <select name="FStatus" id="FStatus">
                                <option value="select">请选择</option>
                                <option value="true">已完成</option>
                                <option value="false">未完成</option>
                            </select>
                        </td>
                        @*<th>
                            是否领料：
                        </th>
                        <td>
                            <select name="selIfChangepwd" id="selIfChangepwd">
                                <option value="select">请选择</option>
                                <option value="true">已领料</option>
                                <option value="false">未领料</option>
                            </select>
                        </td>*@
                    </tr>
                    <tr>
                        <th>
                            计划开工时间：
                        </th>
                        <td>
                            <input name="FPlanCommitDate" id="FPlanCommitDate" class="easyui-datebox"
                                   editable="false" style="width:150px;height:22px;" />
                        </td>


                        <td colspan="4">
                            <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
                               onclick="ui_project_searchdata();">搜索</a>
                            <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-clear" plain="true"
                               onclick="ui_project_cleardata();">清空条件</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div data-options="region:'center',border:false"> 
            <div id="pp" class="easyui-pagination" style="border:1px solid #ccc;"></div>
                <div id="ganttChart" data-options="fit:true,border:false"></div>            
            <div id="eventMessage"></div>
        </div>
    </div>
 
</body>
</html>
